1. Field of the Invention
The invention relates to a data processing and addressing method, and more particularly, to methods for processing and addressing data in an electronic apparatus with volatile memory and non-volatile memory.
2. Description of the Related Art
In electronic apparatuses, such as a computer system or an embedded system, various memory devices are commonly utilized. In such apparatuses, codes executed by a processing unit may be stored in a random access memory (RAM) or a read-only memory (ROM). Size of the ROM is normally smaller than that of the RAM, and the power consumption of the ROM is less than that of RAM. The RAM, however, is more flexible than the ROM. In general, fixed and not often modified functions or codes are stored in the ROM but new functions or often changing functions and patch functions/codes are stored in the RAM. Some of the functions in the ROM may call a function in the RAM such that the execution of the ROM function is jumped to a calling address of the RAM function. The codes in the ROM can not be modified but the codes in the RAM can be modified such that the calling address of the RAM function may be changed to another address. Therefore, when the RAM function called by the ROM function has been accessed, unexpected operation result may be obtained.